package com.mxpio.erp.common.quality.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mxpioframework.jpa.annotation.DictAble;
import com.mxpioframework.jpa.annotation.Generator;
import com.mxpioframework.jpa.policy.impl.CreatedDatePolicy;
import com.mxpioframework.jpa.policy.impl.UUIDPolicy;
import com.mxpioframework.security.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "V_MB_ERP_INSPECTION_BILL_ASSEMBLY_PROBLEM")
@Schema(description="装配问题数量top10")
public class VEInspectionBillAssemblyProblem extends BaseEntity {
    private static final long serialVersionUID = 1L;

    @Id
    @Generator(policy = UUIDPolicy.class)
    @Column(name = "ID_", length = 64)
    @Schema(description = "ID主键")
    private String id;

    @Schema(description = "申请时间（年月）")
    @Column(name = "YEAR_MONTH_")
    private String yearMonth;

//    @Generator(policy = CreatedDatePolicy.class)
//    @Column(name = "CREATE_TIME", updatable = false)
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
//    @Schema(description = "创建时间")
//    private Date createTime;

    @Column(name = "NUM_QUESTIONS_")
    @Schema(description = "问题数量")
    private Long numQuestions;


    @Column(name = "ITEM_NAME_")
    @Schema(description = "物料名称")
    private String itemName ;

    @Column(name = "DRAWING_NO_")
    @Schema(description = "图号")
    private String drawingNo;


//    @Transient
//    private Map<String, String> textMap;
//    public String putText(String key, String value) {
//        if (textMap == null) {
//            textMap = new HashMap<>();
//        }
//        return textMap.put(key, value);
//    }
}
